<div id="hotels_table">
  <%= form_tag room_facility_selected_hotel_room_types_path, remote: true, method: :post do %>
  <%= hidden_field_tag "rti", params[:room_type_id] %>
  <%= hidden_field_tag "hid", params[:hid] %>

  <table class="table">
    <thead>
      <tr>
        <th style="text-align:center;">
          <div class="checkbox-selected">
            <%= check_box_tag "checkall", id: "checkall" %><%= "  " %><%= "Check"  %>
          </div>
        </th>
        <th><%= "Facility" %></th>
      </tr>
    </thead>

    <tbody id="hotels">
      <% @room_facilities.each do |room_fac| %>
        <tr>
          <td class="text-center">
            <% hot_fac_check = RoomTypeFacility.where(' room_type_id =? and room_facility_id =? ', params[:room_type_id], room_fac.id).first %>
            <% if hot_fac_check  %>
              <div class="checkbox-selected"><%= check_box_tag "room_facilities[]", room_fac.id, true %></div>
            <% else %>
              <div class="checkbox-selected"><%= check_box_tag "room_facilities[]", room_fac.id %></div>
            <% end %>
          </td>
        <td><%= room_fac.facility_name_eng %></td>
        </tr>
      <% end %>
      <tr>
        <td class="text-center">
            <%= link_to 'Back', hotel_room_types_path({hid: params[:hid]}), class: "btn btn-inverse", remote: true %>    
        </td>
        <td>
          <%= submit_tag "Save", id: "btn_selected", class: "btn btn-primary" %>
        </td>
      </tr>
    </tbody>
  </table>

  <% end %>

  <div class="collection_paginator">
    <%#= will_paginate hotels %>
  </div>

</div>